package cn.iocoder.yudao.module.crm.dal.mysql.performance.config;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.crm.controller.admin.performance.config.vo.PerformanceConfigDetailPageReqVO;
import cn.iocoder.yudao.module.crm.dal.dataobject.performance.config.PerformanceConfigDetailDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * CRM_业绩配置 Mapper
 *
 * @author 超级管理员
 */



/**
 * CRM_业绩配置 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface PerformanceConfigDetailMapper extends BaseMapperX<PerformanceConfigDetailDO> {

    default PageResult<PerformanceConfigDetailDO> selectPage(PerformanceConfigDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PerformanceConfigDetailDO>()
                .inIfPresent(PerformanceConfigDetailDO::getDeptId, reqVO.getDeptId())
                .inIfPresent(PerformanceConfigDetailDO::getPerformancePoint, reqVO.getPerformancePoint())
                .betweenIfPresent(PerformanceConfigDetailDO::getBelongMonth, reqVO.getBelongMonth())
                .eqIfPresent(PerformanceConfigDetailDO::getTargetValue, reqVO.getTargetValue())
                .orderByDesc(PerformanceConfigDetailDO::getId));
    }

}